1. Field of the Invention
This invention relates to an image reducing apparatus, a reduced image generating method and a computer program for controlling the image reducing apparatus.
2. Description of the Related Art
In an example of the prior art, image compression based upon the JPEG (Joint Photographic Experts Group) standard involves subjecting image data to orthogonal transformation processing. The orthogonal transform coefficients obtained by this orthogonal transformation are recorded on a recording medium. Orthogonal transform coefficients used in image reduction are decided in accordance with a reduction ratio and reduction processing is executed utilizing the orthogonal transform coefficients decided (see the specification of Japanese Patent Application Laid-Open No. 2006-60540). This reduction processing is carried out as indicated below.
With reference to FIG. 15, image compression based upon JPEG is performed in image block units of 8×8 pixels. One frame of an image is divided into a number of image blocks of 8×8 pixels. A number of complete image blocks 181 having 64 pixels I1 to I64 in an 8×8 pixel array are obtained. In a case where one frame of an image has been divided into a number of image blocks, an image block having 64 pixels in an array of 8×8 pixels will be referred to as a “complete image block”. Further, depending upon the size of the original image, there are instances where an image block that does not possess 64 pixels in an array of 8×8 pixels is produced in a case where one frame of an image has been divided into a number of image blocks. An image block that does not possess 64 pixels in an array of 8×8 pixels will be referred to as a “deficient image block”.
In the case of a deficient image block, data referred to as “padding data” is added on in such a manner that the deficient image block will become an image block having 64 pixels in an array of 8×8 pixels. An image block to which padding data has been added will be referred to as a “padded image block”. In a padded image block 191 shown in FIG. 15, it is assumed that the column of eight pixels I65, I73, I81, I89, I97, I105, I113 and I121 contained in this block are represented by original image data and that a portion 192 containing the other pixels is represented by padding data Ip.
Although the complete image block 181 of 64 pixels in an array of 8×8 and the padded image block 191 of 64 pixels in an array of 8×8 to which the padding data Ip has been added are illustrated in FIG. 15, the pixels I1 to I64, I65, I73, I81, I89, I97, I105, I113 and I121 of the original image (one portion thereof) are represented by 72 pixels of image data in an array of 9 pixels horizontally and 8 pixels vertically.
By orthogonally transforming the complete image block 181, a complete orthogonally transformed block 182 composed of 64 orthogonal transform coefficients in an array of 8×8 orthogonal transform coefficients is obtained. The block obtained by orthogonally transforming the complete image block 181 will be referred to as a “complete orthogonally transformed block” 182. The complete orthogonally transformed block 182 contains 64 orthogonal transform coefficients C1 to C64. In a case where compression based upon JPEG is carried out, an orthogonally transformed block obtained by orthogonally transforming an image block is recorded on a recording medium. The orthogonal transform coefficients represent frequency components. The closer a coefficient is to the upper left, the lower the frequency component; the closer the coefficient is to the lower right, the higher the frequency component.
Among the orthogonal transform coefficients C1 to C64 that form the complete orthogonally transformed block 182, those conforming to the reduction ratio are decided in order starting from the low frequency components. For example, if a reduced image has a size that is one-half that of the original image, then orthogonal transform coefficients C1 to C4, C9 to C12, C17 to C20 and C25 to C28 included in a 4×4 block 183 at the upper left of the 8×8 complete orthogonally transformed block 182 are decided upon as the orthogonal transform coefficients to be used. By subjecting these decided orthogonal transform coefficients to an inverse orthogonal transformation, a first reduced image block 184 of 4×4 pixels is obtained.
By orthogonally transforming also the padded image block 191 in a manner similar to that of the complete image block 181, an orthogonally transformed block 193 is obtained. The orthogonally transformed block obtained by orthogonally transforming the padded image block 191 will be referred to as a “padded orthogonally transformed block” 193. In a manner similar to that of the complete orthogonally transformed block 182, orthogonal transform coefficients C65 to C68, C73 to C76, C81 to C84 and C89 to C92 that reside in a 4×4 block 194 are decided upon as orthogonal transform coefficients used in order to generate a reduced image. By subjecting these orthogonal transform coefficients C65 to C68, C73 to C76, C81 to C84 and C89 to C92 to an inverse orthogonal transformation, a second reduced image block 197 of 4×4 pixels is obtained.
Since 9 pixels horizontally and 8 pixels vertically constitute the original image (a portion thereof), a reduced image of 4.5 pixels horizontally and 4 pixels vertically will be generated if the original image is reduced to one-half size. Since the fraction must be raised, however, a reduced image of 5 pixels horizontally and 4 pixels vertically must be produced. Consequently, a portion 199 consisting of pixels p2 to p4, p6 to p8, p10, to p12 and p14 to p16 in second to fourth columns is trimmed from the second reduced image block 197 to thereby extract a portion 196 composed of pixels p1, p5, p9, p13 of the first column. By combining the extracted portion 196 composed of pixels p1, p5, p9, p13 of the first column and the first reduced image block 184, a reduced image (a portion thereof) 200 that is one-half the size of the original image is produced.
A problem, however, is that the portion 196 composed of the pixels p1, p5, p9 and p13 of the first column extracted from the second reduced image block 197 is influenced by the padding data Ip not contained in the original image. As a consequence, there are instances where noise such as an unwanted line appears in the image portion 196 represented by the pixels p1, p5, p9 and p13 at the edge of the reduced image 200 generated.
Since JPEG-compliant compression involves orthogonal transformation using an image block of 8×8 pixels, the orthogonally transformed block obtained by this transformation also is composed of 64 orthogonal transform coefficients in an 8×8 array. In a case where image reduction is applied to an image utilizing orthogonal transform coefficients, the horizontal or vertical length of the reduced image will not be an integral number of pixels when the number of pixels in the horizontal or vertical direction of the original image before compression is not a multiple of eight. As a consequence, the width or height of an edge pixel representing the edge of the reduced image obtained by reduction processing theoretically will have a length indicated by a decimal fraction. Since a length indicated by a decimal fraction cannot be expressed, round-up processing is executed so that the end pixel will be expressed by one pixel. Since the edge portion in the theoretically reduced image is indicated by one pixel despite the fact that it does not have a width or height equivalent to one pixel (i.e., the width or height is a non-integral or fractional pixel), the edge portion of the reduced image takes on an unnatural appearance.